<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
    <title>Intro to SceneLayer - 4.6</title>
    <style>
        html,
        body,
        #viewDiv {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
        }
    </style>

    <link rel="stylesheet" href="https://js.arcgis.com/4.6/esri/css/main.css">
    <script src="https://js.arcgis.com/4.6/"></script>

    <script>
        require([
            "esri/Map",
            "esri/views/SceneView",
            "esri/layers/SceneLayer",

            "dojo/domReady!"
        ], function (Map, SceneView, SceneLayer) {

            // Create Map
            var map = new Map({
                basemap: "dark-gray",
                ground: "world-elevation"
            });

            // Create the SceneView
            var view = new SceneView({
                container: "viewDiv",
                map: map,
                camera: {
                    position: [-74.0338, 40.6913, 707],
                    tilt: 81,
                    heading: 50
                }
            });

            // Create SceneLayer and add to the map
            var sceneLayer = new SceneLayer({
                portalItem: {
                    id: "2e0761b9a4274b8db52c4bf34356911e"
                },
                popupEnabled: false
            });
            map.add(sceneLayer);

            // Create MeshSymbol3D for symbolizing SceneLayer
            var symbol = {
                type: "mesh-3d", // autocasts as new MeshSymbol3D()
                symbolLayers: [{
                    type: "fill", // autocasts as new FillSymbol3DLayer()
                    // If the value of material is not assigned, the default color will be grey
                    material: {
                        color: [244, 247, 134]
                    }
                }]
            };
            // Add the renderer to sceneLayer
            sceneLayer.renderer = {
                type: "simple", // autocasts as new SimpleRenderer()
                symbol: symbol
            };
        });
    </script>
</head>

<body>
    <div id="viewDiv"></div>
</body>

</html>